#ifndef __OFP_PROT_COMMON__
#define __OFP_PROT_COMMON__

#include <stdint.h>
#include "common.h"

#ifdef __cplusplus
extern "C" {
#endif

#define OFP_LEN_1 1
#define OFP_LEN_2 2
#define OFP_LEN_3 3
#define OFP_LEN_4 4
#define OFP_LEN_5 5
#define OFP_LEN_8 8


#define OFP_INDEX_TABLE_MAX 32

#define OFP_AUTOENROLL_TIMES_MAX   15  //自动录入模板最大次数
#define OFP_ENROLL_NUM_MAX 32

typedef enum {
    OFP_ENROLL_VALIDITY_CHECK= 0x00u,
    OFP_ENROLL_CAPTURE = 0x01u,
    OFP_ENROLL_CREATE_FEATURE = 0x02u,
    OFP_ENROLL = 0x03u,
    OFP_ENROLL_MERGE_TEMPLATE = 0x04u,
    OFP_ENROLL_CONFLICT = 0x05u,
    OFP_ENROLL_STORE_TEMPLATE = 0x06u,
} ofp_enroll_result_param1;

typedef enum {
    OFP_IDENTIFY_VALIDITY_CHECK= 0x00u,
    OFP_IDENTIFY_CAPTURE = 0x01u,
    OFP_IDENTIFY_SEARCH = 0x05u,
    OFP_IDENTIFY_MUTY_SEARCH = 0xf5u,
} ofp_identify_result_param1;


typedef struct {
    uint8_t firmware_version[OFP_FIRMWARE_VERSION_LEN_MAX];
    uint32_t len;
} ofp_firmware_version;


typedef struct {
    uint8_t fp_index[OFP_INDEX_TABLE_MAX];
    uint32_t fp_enrolled_number; //指纹数量
    uint32_t fp_next_enroll_id; //
} ofp_index_table;

typedef struct {
    uint8_t auto_enroll_times;      //自动注册模板次数
    uint8_t validity_check_result;  //合法性检测结果
    uint8_t validity_check_flag;  //合法性检测标志
    uint8_t capture_result[OFP_AUTOENROLL_TIMES_MAX + 1];   //当前采图结果，下标1开始
    uint8_t current_enroll_times;       //当前录入次数
    uint8_t current_enroll_flag;        //当前录入结束标志，0: 未结束，1: 结束

    uint8_t create_feature_result[OFP_AUTOENROLL_TIMES_MAX + 1];    //当前生成特征结果，下标1开始
    uint8_t enroll_result[OFP_AUTOENROLL_TIMES_MAX + 1];    //当前录入结果，下标1开始
    uint8_t merge_template_result;  //合并模板结果
    uint8_t enroll_conflict_result; //已注册检测结果
    uint8_t store_template_result;  //模板存储结果
    uint8_t enroll_finish_flag; //自动录入结束标志，0: 未结束，1: 结束
} ofp_enroll_result;


typedef struct {
    uint8_t validity_check_result;  //合法性检测结果

    uint8_t validity_check_flag;  //合法性检测标志
    uint8_t capture_result; //当前采图结果

    uint8_t capture_flag; //当前采图标志
    uint8_t search_result;  //搜索结果
    uint32_t search_num;        //搜索比对成功的指纹数量
    uint16_t search_id[OFP_ENROLL_NUM_MAX];     //搜索成功对应的id
    uint16_t score;         //比对得分
    uint8_t identify_finish_flag; //自动录入结束标志，0: 未结束，1: 结束
} ofp_identify_result;

#ifdef __cplusplus
}
#endif


#endif

